<?php
class Template
{
	protected $variables = array();
	protected $_controller;
	protected $_action;
	
	/**
	 * @param string $controller
	 * @param string $action
	 */
	public function __construct($controller, $action)
	{
		$this->_controller = $controller;
		$this->_action = $action;
	}
	
	/**
	 * @param string $name
	 * @param string $value
	 */
	public function set($name, $value)
	{
		$this->variables[$name] = $value;
	}
	
	public function render()
	{
		extract($this->variables);
		include(ROOT . DS . 'app' . DS . 'views' . DS . 'header.php');
		include(ROOT . DS . 'app' . DS . 'views' . DS . $this->_controller . DS . $this->_action . '.php');
		include(ROOT . DS . 'app' . DS . 'views' . DS . 'footer.php');
	}
	
}